proc msg:comment {nick host handle arg} {
  global botnick
  set argument [lindex $arg 0]

  # if channel is in argument
  if {[string match "#*" $argument]} {
    # if channel is valid
    if {[validchan $argument]} {
      set chan $argument
      set otbn1 [lindex $arg 1]
      set botnet [lrange $arg 1 end]
    } else {
      putquick "NOTICE $nick :\0034ERROR - This bot is not $argument."
      return 0
    }
  } else {
    putquick "NOTICE $nick :\0034ERROR - You need to specify a channel."
    return 0
  }

  # if user does not have any access in the channel...
  if {![matchattr $handle o|v $chan] && ![matchattr $handle o|o $chan]} {
    putquick "NOTICE $nick :\0034ERROR - Permission Denied."
    return 0
  } 

  # If user is not authed
  if {![matchattr $handle A]} {
    putquick "NOTICE $nick :\0034ERROR - Unable To Execute Command - You need to authenticate first - Permission Denied."
    putquick "NOTICE $nick :\00312You may authenticate yourself by typing \0033\002/msg $botnick auth <your password>\002"
    return 0
  }

  # If user acct is disabled
  if {[matchattr $handle D]} {
    putquick "NOTICE $nick :\0034ERROR - Permission Denied - Access Is Disabled.."
    return 0
  }

  comment $nick $handle $host $chan $otbn1 $botnet
  return 0
}









